﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNetNinjaLibrary.Actions
{
	public class HitAction : IUnitAction
	{
		private Unit target;
		private Direction hitDirection;

		public HitAction(Unit target, Direction hitDirection)
		{
			this.target = target;
			this.hitDirection = hitDirection;
		}

		public long TimeNeeded
		{
			get { return ((int)this.hitDirection) % 2 == 0 ? this.target.Speed : MathsHelper.TimeForDiagonal(this.target.Speed); }
		}

		public bool CanExecute()
		{
			return true;
		}

		public void Execute()
		{
			// TODO: If there is an enemy at the pointed direction, take from its life.
		}
	}
}